<?php

use Illuminate\Database\Seeder;
use App\Models\User;

class UserSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        DB::table("users")->truncate();
        //使用工厂生成测试数据  100条
        factory(User::class,100)->create();

        //指定第一条用户信息的用户名
        User::where('id',1)->update(['username' => 'admin']);
    }
}
